para parea
IF FIL_LOCK(0)
   APPEN BLANK
ENDIF
IF REC_LOCK(0)
   REPL PAT_FILCOD WITH KDPAT,PAT_CODTYP WITH TPPAT,PAT_M_INIT WITH MNMPAT,SALE_PRICE WITH UNPR
   REPL PAT_NAME WITH NMPAT,PAT_F_NAME WITH FNMPAT,VISIT_NBER WITH NOBER,DATE_VISIT WITH DATE()
   REPL PHAR_NBER WITH STR(NDRUG,2),PHAR_CODE WITH DRUGK,PHAR_NAME WITH NMDR,PHAR_TYPE WITH TPDR
   REPL PHAR_QANT WITH QANT,PHAR_UNIT WITH UNNI,SELL_UNIT WITH SEUN,phar_price with totpr
   REPL PHAR_PAY WITH PPRIC,PHAR_X WITH DQNT
   repl phar_ms with MPRIC
   repl area with SERIAL   
ENDIF
UNLOCK
